/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.impl;

import com.qdu.dao.OrdersendingformDao;
import com.qdu.util.DatabaseUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author SBH
 */
public class OrdersendingformImpl implements OrdersendingformDao {

    @Override
    public List getMyDD(String ordersendingform_userid) {

        Connection con = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        List list = new ArrayList();

        try {
            con = DatabaseUtil.getConnection();
            ps = con.prepareStatement("select ordersendingform_id,ordersendingform_formnumber,ordersendingform_sendok,fangshi from  ordersendingform where ordersendingform_userid=? and zhuangtai='正常' order by ordersendingform_id desc");
            ps.setString(1, ordersendingform_userid);
            rs = ps.executeQuery();
            con.commit();
            while (rs.next()) {
                List list2 = new ArrayList();
                list2.add(rs.getString(1));
                list2.add(rs.getString(2));
                list2.add(rs.getString(3));
                list2.add(rs.getString(4));
                list.add(list2);

            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            DatabaseUtil.close(rs, ps, con);
        }
        return list;

    }

}
